<?
/**
 * View user template
 */
(basename($_SERVER['PHP_SELF']) == basename(__FILE__)) && die('Access Denied');

// title
$this->setTitle(WEB_APP_NAME . ' : ' . OPT_VIEW);

// validate required template variables
$item = $this->getVar('item');
if (!($item instanceof Source)) {
	die($this->getPageError('Object instance is missing.'));
	}

// Are there errors?
$hasErrors = (is_array($this->getErrors()) and count($this->getErrors()));
$canDel = ($item->canDelete());

// generate boilerplate html
$class = '';

// print css
$this->addCss('css/print.css');
$this->addJs('js/menu.js');
?>
<?= $this->getPageHeader(); ?>
<? if ($hasErrors) { ?>
<div id="container-error">
<?= implode('<br />', $this->getErrors()); ?>
</div>
<? } ?>
<div align="center">
<div id="page-container">
<div id="container-medium">
<?= getMenuBars(OPT_VIEW, $canDel); ?>
</div> <!-- container-medium -->

<div id="container-medium">
<div class="content-view">

<? if ($item->populated) { ?>
<table cellpadding="2" cellspacing="2">
<!--
  Account Information
-->
	<tr>
		<td class="category" colspan="2">
			Source Information
		</td>
	</tr>
	<tr>
		<th>Internal ID</th>
		<td><?= $item->Id(); ?></td>
	</tr>
	<tr>
<? $prop = 'Source'; ?>
	<tr>
		<th><?= htmlspecialchars($item->getPropertyDescription($prop)); ?></th>
		<td><?= htmlspecialchars($item->Source()); ?></td>
	</tr>
</table>
<? } // $item->populated ?>

</div> <!-- content-view -->
</div> <!-- container-medium -->
</div> <!-- page-container -->
</div> <!-- center -->
<script type="text/javascript">
doMenuMsg('<?= OPT_VIEW; ?>');
</script>
<?= $this->getPageFooter(); ?>
